package com.java.threaddemo4;

import java.util.Scanner;

public class TestDriver {

	public static void main(String[] args) {
		test01();
	}

	/**
	 * 继承实现多线程
	 */
	private static void test01() {
		// 创建MyThread1类的实例对象
		MyThread1 t1 = new MyThread1("mythread1");
		t1.start();

		// 从控制台输入
		System.out.println("若想退出，则输入【exit】");
		Scanner sc = new Scanner(System.in);
		String strStopped = sc.next();
		if (strStopped.trim().equalsIgnoreCase("exit")) {
			//属性没有多态
			t1.setStopped(true);
		}
		System.out.println("程序结束");

	}
}
